﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BGCOP.CAVTOP.WINFORMS.frmtlk;
using Telerik.WinControls.UI.Localization;

namespace BGCOP.CAVTOP.WINFORMS
{
    public partial class frmModeloVehiculo2 : Form
    {
        public frmModeloVehiculo2()
        {
            InitializeComponent();
        }

        private void tModeloVehiculoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Desea realizar las operaciones pendientes?", Properties.Settings.Default.Titulo,
                MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
            {
                this.Validate();
                this.tModeloVehiculoBindingSource.EndEdit();
                this.tableAdapterManager.UpdateAll(this.masterDBACDataSet);
                MessageBox.Show("El registro se proceso con exito!", Properties.Settings.Default.Titulo
                                , MessageBoxButtons.OK);
            }
        }

        private void frmModeloVehiculo2_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'masterDBACDataSet.TipoVehiculo' table. You can move, or remove it, as needed.
            this.tipoVehiculoTableAdapter.Fill(this.masterDBACDataSet.TipoVehiculo);
            // TODO: This line of code loads data into the 'masterDBACDataSet.TMarcaVehiculo' table. You can move, or remove it, as needed.
            this.tMarcaVehiculoTableAdapter.Fill(this.masterDBACDataSet.TMarcaVehiculo);
            // TODO: This line of code loads data into the 'masterDBACDataSet.TVehiculo' table. You can move, or remove it, as needed.
            this.tVehiculoTableAdapter.Fill(this.masterDBACDataSet.TVehiculo);
            // TODO: This line of code loads data into the 'masterDBACDataSet.TModeloVehiculo' table. You can move, or remove it, as needed.
            this.tModeloVehiculoTableAdapter.Fill(this.masterDBACDataSet.TModeloVehiculo);
            RadGridLocalizationProvider.CurrentProvider = new MyEnglishRadGridLocalizationProvider();
        }

        private void radGridView1_CellBeginEdit(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e)
        {
            e.Row.Cells["fechaUltimaGestion"].Value = DateTime.Now;
            e.Row.Cells["usuarioUltimaGestion"].Value = BGCOP.CAVTOP.WINFORMS.Program.idUsuarioActual;
        }
    }
}
